#pragma once

#include <QtWidgets/QMainWindow>
#include <QMessageBox>
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
#include <QDir>

#include <QTimer>
#include <QBuffer>
#include <opencv.hpp>
#include "ui_QtOpenCvAddEmployee.h"

using namespace cv;
using namespace std;

class QtOpenCvAddEmployee : public QMainWindow
{
    Q_OBJECT

public:
    QtOpenCvAddEmployee(QWidget* parent = nullptr);
    ~QtOpenCvAddEmployee();
    void closeEvent(QCloseEvent* event);
public slots:
    void open();
private:
    Ui::QtOpenCvAddEmployeeClass ui;
private:
    //人脸识别定义
    VideoCapture videoCap;
    CascadeClassifier faceCascade;//人脸检测
    QTimer checkTimer;
    //记录提交次数
    int numSubFace;
    //待提取特征向量的Mat图片数据
    Mat faceData;
    //特征向量和描述点
    std::vector<cv::KeyPoint> keypoints1, keypoints2, keypoints3;
    cv::Mat descriptors1, descriptors2, descriptors3;
    

private slots:
    void faceDetector();
    void checkFace(cv::Mat videoFrame);
    void saveFace();




protected:
protected slots:
    void on_ackButton_clicked();
};